<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix' => config('admin.route.prefix'),
    'namespace' => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
    $router->resource('users', UserController::class);
    $router->resource('about_us', AboutUsController::class);
    $router->resource('article', ArticleController::class);
    $router->resource('course', CourseController::class);
    $router->get('course/{id}/course_times/create', 'CourseTimeController@create_with_course');
    $router->get('course/{cid}/course_times/{tid}/edit', 'CourseTimeController@edit_course_time');
    $router->put('course/{cid}/course_times/{tid}', 'CourseTimeController@update_course_time');
    $router->delete('course/{cid}/course_times/{tid}', 'CourseTimeController@destroy_course_time');
    $router->post('course/{id}/course_times', 'CourseTimeController@store');

    $router->get('course/{id}/course_times', 'CourseTimeController@course_times');
    $router->resource('course_time', CourseTimeController::class);
    $router->resource('baby', BabyController::class);
    $router->resource('month_age', MonthAgeController::class);
    $router->resource('town', TownController::class);
    $router->post('/baby/import', 'BabyController@import_from_excel');
    $router->get('/baby/{id}/courses', 'BabyController@courses');
    $router->resource('subscribe', SubscribeController::class);

});
